package com.ktwlrj.securitycenter.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ktwlrj.core.base.ActionResult;
import com.ktwlrj.core.base.SuperController;
import com.ktwlrj.core.exception.ActionException;
import com.ktwlrj.securitycenter.controller.args.SafeTriggerLogPageArgs;
import com.ktwlrj.securitycenter.dto.SafeTriggerLogPageDto;
import com.ktwlrj.securitycenter.service.SafeTriggerLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 触发日志控制层
 *
 * @author code generation
 * @date 2020-02-24 18:08:13
 * @since JDK1.8
 */
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@Api(tags = "SafeTriggerLog", value = "SafeTriggerLogApi", description = "触发日志接口相关")
@RequestMapping(value = "safeTriggerLog", produces = MediaType.APPLICATION_JSON_VALUE)
public class SafeTriggerLogController extends SuperController{
    private final SafeTriggerLogService service;

    @ApiOperation(value = "分页查询(v1.0.0)", notes = "分页查询")
    @PostMapping(value = "/select/page")
    public ActionResult<IPage<SafeTriggerLogPageDto>> selectPage(@RequestBody @Valid SafeTriggerLogPageArgs args) throws ActionException {
        return success(service.page(args));
    }
}